package me.flyray.bsin.infrastructure.biz.paychannel.joinpay.client;

import io.swagger.v3.oas.annotations.parameters.RequestBody;
import me.flyray.bsin.infrastructure.biz.paychannel.joinpay.domain.request.OrderQueryRequest;
import me.flyray.bsin.infrastructure.biz.paychannel.joinpay.domain.response.OrderResponse;
import me.flyray.bsin.infrastructure.biz.paychannel.joinpay.domain.response.UniPayResponse;
import org.springframework.http.MediaType;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.service.annotation.GetExchange;
import org.springframework.web.service.annotation.HttpExchange;
import org.springframework.web.service.annotation.PostExchange;

@HttpExchange(url = "${join-pay.base-url}")
public interface JoinPayClient {

    /**
     * 统一下单
     * @param requestMap
     * @return
     */
    @PostExchange(url = "/tradeRt/uniPay",contentType = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    UniPayResponse unifiedOrder(MultiValueMap<String, String> requestMap);

    /**
     * 订单查询
     * @param orderQuery
     * @return
     */
    @GetExchange(url = "/tradeRt/uniPayQuery")
    OrderResponse orderQuery(@RequestParam OrderQueryRequest orderQuery);

}
